All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kzs_surface.h File Reference

Drawable surface. More...

Macros

#define KZS_SURFACE_PROPERTY_DONT_CARE
 Indicates that the implementation can choose any value for a surface property. More...
 

Functions

KANZI_API kzsError kzsSurfaceCreate (const struct KzsDesktop *desktop, const struct KzsDisplay *display, const struct KzsSurfaceConfiguration *configuration, const struct KzsWindow *window, struct KzsSurface **out_surface)
 Creates a drawable surface for a window. More...
 
KANZI_API kzsError kzsSurfaceDelete (struct KzsSurface *surface)
 Deletes a surface and frees all memory allocated for it. More...
 
KANZI_API kzsError kzsSurfaceSetActive (const struct KzsSurface *surface, kzBool active)
 Makes a surface active for drawing or deactivates it. More...
 
KANZI_API kzsError kzsSurfaceUpdate (const struct KzsSurface *surface)
 Updates the buffer to the screen. More...
 
KANZI_API kzsError kzsSurfaceResize (struct KzsSurface *surface, kzUint width, kzUint height)
 Resizes the surface. More...
 
KANZI_API kzsError kzsSurfaceSetSwapInterval (struct KzsSurface *surface, kzInt interval)
 Specifies the minimum number of video frame periods per buffer swap. More...
 
KANZI_API kzsError kzsSurfaceReadPixels (const struct KzsSurface *surface, void *out_pixels)
 Reads pixels from the surface. More...
 
KANZI_API kzsError kzsSurfaceNativeCreate (const struct KzsDesktop *desktop, const struct KzsDisplay *display, const struct KzsSurfaceConfiguration *configuration, const struct KzsWindow *window, struct KzsSurfaceNative **out_surfaceNative)
 Creates a native surface. More...
 
KANZI_API kzsError kzsSurfaceNativeDelete (struct KzsSurfaceNative *surfaceNative)
 Deletes a native surface and frees all memory allocated for it. More...
 
KANZI_API kzsError kzsSurfaceNativeSetActive (struct KzsSurfaceNative *surfaceNative, kzBool active)
 Sets surface active. More...
 
KANZI_API kzsError kzsSurfaceNativeUpdate (struct KzsSurfaceNative *surfaceNative)
 Updates the surface. More...
 
KANZI_API kzsError kzsSurfaceNativeSetSwapInterval (struct KzsSurfaceNative *surfaceNative, kzInt interval)
 Specifies the minimum number of video frame periods per buffer swap. More...
 
KANZI_API kzsError kzsSurfaceNativeReadPixels (struct KzsSurfaceNative *surfaceNative, void *out_pixels)
 Copy color buffer data to the preallocated buffer out_pixels. More...
 
KANZI_API kzsError kzsSurfaceNativeCreateImage (void *display, void *context, kzInt target, void *data, kzInt *attributes, void **out_image)
 Function for creating native image object, which can be shared between client APIs. More...
 
KANZI_API kzsError kzsSurfaceNativeDeleteImage (void *display, void *image)
 Function for deleting native image object. More...
 
KANZI_API void * kzsSurfaceNativeGetDisplay (struct KzsSurfaceNative *surfaceNative)
 Gets the display from native surface. More...
 
KANZI_API void * kzsSurfaceNativeGetContext (struct KzsSurfaceNative *surfaceNative)
 Gets the context from native surface. More...
 
KANZI_API struct KzsSurfaceNative * kzsSurfaceGetNativeSurface (const struct KzsSurface *surface)
 Get native surface from surface. More...
 
KANZI_API kzString kzsSurfaceNativeGetExtensions (struct KzsSurfaceNative *surfaceNative)
 Get list of native surface extensions. More...
 
KANZI_API kzsError kzsSurfaceGetUsedSurfaceProperties (const struct KzsSurface *surface, struct KzsSurfaceProperties *out_surfaceProperties)
 Sets used surface settings to the given surface properties struct. More...
 
KANZI_API kzsError kzsSurfaceGetUsedSurfaceNativeProperties (const struct KzsSurfaceNative *surfaceNative, struct KzsSurfaceProperties *out_surfaceProperties)
 Sets used surface settings to the given surface properties struct. More...
 
KANZI_API void kzsSurfaceLogProperties (const KzsSurface *surface)
 Outputs the properties of the surface to the log. More...
 

Detailed Description

Drawable surface.

Copyright 2008-2020 by Rightware. All rights reserved.

Macro Definition Documentation

#define KZS_SURFACE_PROPERTY_DONT_CARE

Indicates that the implementation can choose any value for a surface property.

Function Documentation

KANZI_API kzsError kzsSurfaceCreate ( const struct KzsDesktop desktop,
const struct KzsDisplay display,
const struct KzsSurfaceConfiguration configuration,
const struct KzsWindow window,
struct KzsSurface **  out_surface 
)

Creates a drawable surface for a window.

Graphics context of the new surface is shared with the currently active surface if the rendering APIs match. This function may change the active surface.

KANZI_API kzsError kzsSurfaceDelete ( struct KzsSurface surface)

Deletes a surface and frees all memory allocated for it.

KANZI_API kzsError kzsSurfaceSetActive ( const struct KzsSurface surface,
kzBool  active 
)

Makes a surface active for drawing or deactivates it.

Only one surface can be active at a time.

KANZI_API kzsError kzsSurfaceUpdate ( const struct KzsSurface surface)

Updates the buffer to the screen.

KANZI_API kzsError kzsSurfaceResize ( struct KzsSurface surface,
kzUint  width,
kzUint  height 
)

Resizes the surface.

KANZI_API kzsError kzsSurfaceSetSwapInterval ( struct KzsSurface surface,
kzInt  interval 
)

Specifies the minimum number of video frame periods per buffer swap.

Negative interval values are reserved for platform-specific special cases.

KANZI_API kzsError kzsSurfaceReadPixels ( const struct KzsSurface surface,
void *  out_pixels 
)

Reads pixels from the surface.

KANZI_API kzsError kzsSurfaceNativeCreate ( const struct KzsDesktop desktop,
const struct KzsDisplay display,
const struct KzsSurfaceConfiguration configuration,
const struct KzsWindow window,
struct KzsSurfaceNative **  out_surfaceNative 
)

Creates a native surface.

KANZI_API kzsError kzsSurfaceNativeDelete ( struct KzsSurfaceNative *  surfaceNative)

Deletes a native surface and frees all memory allocated for it.

KANZI_API kzsError kzsSurfaceNativeSetActive ( struct KzsSurfaceNative *  surfaceNative,
kzBool  active 
)

Sets surface active.

KANZI_API kzsError kzsSurfaceNativeUpdate ( struct KzsSurfaceNative *  surfaceNative)

Updates the surface.

KANZI_API kzsError kzsSurfaceNativeSetSwapInterval ( struct KzsSurfaceNative *  surfaceNative,
kzInt  interval 
)

Specifies the minimum number of video frame periods per buffer swap.

Negative interval values are reserved for platform-specific special cases.

KANZI_API kzsError kzsSurfaceNativeReadPixels ( struct KzsSurfaceNative *  surfaceNative,
void *  out_pixels 
)

Copy color buffer data to the preallocated buffer out_pixels.

KANZI_API kzsError kzsSurfaceNativeCreateImage ( void *  display,
void *  context,
kzInt  target,
void *  data,
kzInt attributes,
void **  out_image 
)

Function for creating native image object, which can be shared between client APIs.

KANZI_API kzsError kzsSurfaceNativeDeleteImage ( void *  display,
void *  image 
)

Function for deleting native image object.

KANZI_API void* kzsSurfaceNativeGetDisplay ( struct KzsSurfaceNative *  surfaceNative)

Gets the display from native surface.

KANZI_API void* kzsSurfaceNativeGetContext ( struct KzsSurfaceNative *  surfaceNative)

Gets the context from native surface.

KANZI_API struct KzsSurfaceNative* kzsSurfaceGetNativeSurface ( const struct KzsSurface surface)

Get native surface from surface.

KANZI_API kzString kzsSurfaceNativeGetExtensions ( struct KzsSurfaceNative *  surfaceNative)

Get list of native surface extensions.

KANZI_API kzsError kzsSurfaceGetUsedSurfaceProperties ( const struct KzsSurface surface,
struct KzsSurfaceProperties out_surfaceProperties 
)

Sets used surface settings to the given surface properties struct.

KANZI_API kzsError kzsSurfaceGetUsedSurfaceNativeProperties ( const struct KzsSurfaceNative *  surfaceNative,
struct KzsSurfaceProperties out_surfaceProperties 
)

Sets used surface settings to the given surface properties struct.

KANZI_API void kzsSurfaceLogProperties ( const KzsSurface surface)

Outputs the properties of the surface to the log.